package com.xyd.Biz.Impl;

import com.xyd.Biz.MessageBiz;
import com.xyd.Dao.MessageDao;
import com.xyd.Entity.Message;
import com.xyd.Util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class MessageBizImpl implements MessageBiz {
    private SqlSession sqlSession =null;
    private MessageDao dao = null;

    public MessageBizImpl(){
        sqlSession = SqlSessionFactoryUtil.open();
        dao = sqlSession.getMapper(MessageDao.class);
    }

    @Override
    public List<Message> selectMsgBL(int start,String falg) {
        return dao.selectMsgBL(start,falg);
    }

    @Override
    public int selectMsgBLcount(String falg) {
        return dao.selectMsgBLcount(falg);
    }

    @Override
    public int insertMsgByMsg(Message msg) {
         return dao.insertMsgByMsg(msg);
    }

    @Override
    public Message selectMsgbyId(int id) {
        return dao.selectMsgbyId(id);
    }

    @Override
    public int updateMsgByMsg(Message message) {
        return dao.updateMsgByMsg(message);
    }

    @Override
    public List<Message> selectMsgPL(int start, int id) {
        return dao.selectMsgPL(start,id);
    }

    @Override
    public int selectMsgPLcount(int id) {
        return dao.selectMsgPLcount(id);
    }
}
